<!--
 * @Descripttion:安装设备列表
 * @version: 
 * @Author: gonghong
 * @Date: 2023-07-07 09:31:41
-->
<script setup>
import { toPageAuth } from '@/common/utils'
const props = defineProps({
  item: {
    type: Object,
    default: () => {
      return {}
    }
  }
})

/**
 * @name 跳转安装设备页面
 * @return {*}
 */
const installOnClick = () => {
  toPageAuth(`/homePages/maintenance/index`, (res) => {
    res.eventChannel.emit('getData', props.item)
  })
}
</script>
<template>
  <uni-card :title="item.deviceName" :extra="item.installationStatusName">
    <view class="listCard">
      <cell class="f-df f-jc-b">
        <text>设备名称:</text>
        <text>{{ item.deviceName || '无' }}</text>
      </cell>
      <cell class="f-df f-jc-b">
        <text>工单状态:</text>
        <text>{{ item.levelName || '无' }}</text>
      </cell>
      <cell class="f-df f-jc-b">
        <text>用户名称:</text>
        <text>{{ item.userName || '无' }}</text>
      </cell>
      <cell class="f-df f-jc-b">
        <text>用户手机号:</text>
        <text>{{ item.phoneNo || '无' }}</text>
      </cell>
      <cell class="f-df f-jc-b">
        <text>告警类型名称:</text>
        <text>{{ item.alarmTypeName || '无' }}</text>
      </cell>
      <cell class="f-df f-jc-b">
        <text>创建时间:</text>
        <text>{{ item.createTime || '无' }}</text>
      </cell>
      <view style="diplay: flex; word-break: break-all" class="f-df f-jc-b">
        <text>用户地址:</text>
        <text style="flex: 1; text-align: right">
          {{
            `${item.cityName || ''}${item.areaName || ''}${item.buildName || ''}${
              item.unitName || ''
            }${item.addr || ''}`
          }}
        </text>
      </view>
    </view>
    <view
      class="btn-box"
      v-if="item.orderStatus === 'HANDLED' || item.orderStatus === 'EVALUATE' ? false : true"
    >
      <view class="primaryBtn" @click="installOnClick">
        <!-- <uni-icons type="trash" size="18" color="#fff"></uni-icons> -->
        <text>维修</text>
      </view>
    </view>
    <!-- <view slot="actions" class="card-actions" v-if="item.installationStatus==='1'?false:true">
            
            <view class="card-actions-item" @click="installOnClick">
                <uni-icons type="gear-filled" size="18" color="#999"></uni-icons>
                <text class="card-actions-item-text">处理</text>
            </view>
        </view> -->
  </uni-card>
</template>

<style lang="scss" scoped>
.listCard {
  display: flex;
  flex-direction: column;
}

.btn-box {
  display: flex;
  justify-content: flex-end;
  margin-top: 24upx;
}
</style>
